package com.bi.design.mqtt.borker.props;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties("mqtt.broker")
@Getter
@Setter
public class BrokerProperties {
    /**
     * Broker唯一标识,
     */
    private String id;
    /**
     * SSL启动的IP地址, 默认127.0.0.1
     */
    private String host;

    /**
     * SSL端口号, 默认5429端口
     */
    private int port=1883;

    /**
     * WebSocket SSL端口号, 默认5428端口
     */
    private int websocketPort;

    /**
     * WebSocket 是否启用
     */
    private boolean websocketEnabled;

    /**
     * SSL是否启用
     */
    private boolean sslEnabled;

    /**
     * SSL密钥文件密码
     */
    private String sslPassword;

    /**
     * 心跳时间(秒), 默认60秒, 该值可被客户端连接时相应配置覆盖
     */
    private int keepAlive;

    /**
     * 是否开启Epoll模式, 默认关闭
     */
    private boolean useEpoll;

    /**
     * Sokcet参数, 存放已完成三次握手请求的队列最大长度, 默认511长度
     */
    private int soBacklog;

    /**
     * Socket参数, 是否开启心跳保活机制, 默认开启
     */
    private boolean soKeepAlive;

    /**
     * MQTT.Connect消息必须通过用户名密码验证
     */
    private boolean mqttPasswordMust;

    private String websocketPath;

    private int bossGroup_nThreads;

    private int workerGroup_nThreads;
}
